<?php 
	//Finding the Length of a String
	$str = "Hello";
	echo strlen($str).'<br>';
	echo strlen("Good Bye").'<br>';

	//useful related function is str_word_count() , which returns the number of words in a string.
	echo str_word_count("Good Bye").'<br>';

	//Accessing Characters within a String
	echo $str[0].'<br>';
	echo $str.'<br>';
	$str[strlen($str)] = '!';
	echo $str."<br>";

	//If you need to extract a sequence of characters from a string, you can use PHP ’ s substr() function.
	//You can ’ t modify characters within strings using substr()
	// If you need to change characters within a string, use substr_replace() instead.
	echo substr($str, 0, 3).'<br>';
	echo substr($str, 2).'<br>';
	echo substr($str, -1).'<br>';
	echo substr($str, -4, -1).'<br>';
?>